﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// using SGS.Rule;

namespace SGS.Cards
{
    public static class CardLogicHelper
    {
        public static CardType CheckBangType( params Card[] cards )
        {
            if (cards.Length == 0 || cards.Length > 1)
            {
                return CardType.Bang;
            }
            else
            {
                return cards[0].CardType;
            }
        }

        public static CardColor CheckCardColor( params Card[] cards )
        {
            CardColor color = CardColor.None;

            foreach (var c in cards)
            {
                switch (c.Suit)
                {
                    case Suit.Spade:
                    case Suit.Club:
                        color |= CardColor.Black;
                        break;
                    case Suit.Heart:
                    case Suit.Diamond:
                        color |= CardColor.Red;
                        break;
                    case Suit.None:
                    default:
                        color |= CardColor.NoColor;
                        break;
                }
            }

            return color;
        }
    }
}
